import { S, U, getRequestId } from '../../lib/backend'
import Q from 'q'
import axios from 'axios'
import env from '../../config/common'
import N from '../../lib/notification'
import { UPDATE_USER } from '../mutation-types'
const localStorage = require('store')

export default {
  signature ({ commit, state, rootState }, info) {
    const API_HOST = env.CRM_API_HOST
    return Q.Promise((resolve, reject) => {
      axios.get(API_HOST + '/signature').then((response) => {
        if (response.data.errcode === 0) {
          resolve(response.data.results)
        } else {
          N.notify('error', '授权失败！')
        }
      }).catch(error => {
        N.notify('error', '系统发生错误！请联系管理员!')
      })
    })
  }
}
